package g2.routemaster.gui;

import g2.routemaster.gui.contents.GameBoardComposite;

public class BoardSingleton {
   private static BoardSingleton instance;
   private GameBoardComposite gameBoard;
   
   private BoardSingleton() {
   }
   
   public static BoardSingleton instance() {
      if (instance == null) {
         instance = new BoardSingleton();
      }
      return instance;
   }

   /**
    * @param gameBoard the gameBoard to set
    */
   public void setGameBoard(GameBoardComposite gameBoard) {
      this.gameBoard = gameBoard;
   }
   
   public void updatePlayerData(){
      gameBoard.updatePlayers();
   }
   
   public void updateBoardCardData(){
      gameBoard.updateBoardCards();
   }
   
   public void updateBoardData(){
      gameBoard.updateBoard();
   }
   
   public void updateOfficials(){
      gameBoard.updateOfficials();
   }
   
   public void updateAll(){
      updateOfficials();
      updatePlayerData();
      updateBoardData();
      updateBoardCardData();
   }
}
